<?php

?>
<div id='menu-list'>
        <?php
        if(isset($_SESSION['uid'])){
        $query = "SELECT `user_avatar` FROM `user` WHERE `user_id`= {$_SESSION['uid']}";
        $result = mysqli_query($dbc, $query);
        if(mysqli_num_rows($result)>0){
            list($user_avatar) = mysqli_fetch_array($result,MYSQLI_NUM);
                if($user_avatar != ''){
                    echo "<div id='menu-uavatar'><a href='./TrangCaNhan.php?uid={$_SESSION['uid']}'><img src='Images/Uploads/".$user_avatar."' alt='uver-avatar' width='50' height='50'/></a></div>";
                }else{
                    echo "<div id='menu-uavatar'><a href='./TrangCaNhan.php?uid={$_SESSION['uid']}'><img src='Images/Uploads/users.png' alt='uver-avatar' width='50' height='50'/></a></div>";
        }
        }
        }
         ?>
            <ul id='menu-list-ul'>
                <?php
                if(isset($_SESSION['uid'])){
                    echo "<li><a href='./index.php'><img src='Images/menu-home.png' alt='home'> Trang chủ</a></li>"                    
                    ."<li><a href='./PhongChat.php?gid=1'><img src='Images/menu-room.png' alt='chat-room'> Phòng chat chung</a></li>"
                    . "<li><a href='./Thoat.php'><img src='Images/menu-out.png' alt='out'> Thoát</a></li>";
                }else{
                    echo "<li><a href='./index.php'><img src='Images/menu-home.png' alt='home'> Trang chủ</a></li>"
                    . "<li><a href='./Dangnhap.php'><img src='Images/menu-in.png' alt='in'> Đăng nhập</a></li>"
                    . "<li><a href='./Dangky.php'><img src='Images/menu-register.png' alt='register'> Đăng ký</a></li>";
                }
                ?>
                
            </ul>
        </div>